require(["jquery", "core-ajax", "bootstrap", "cookies", "path"], function (a, b) {
    function c() {
        h = a(window).height(), t = a(document).scrollTop(), t >= 100 ? a("#backTop").fadeIn("fast") : a("#backTop").fadeOut("fast")
    }

    function d() {
        b({
            url: a.apiContext + "logout", type: "GET", success: function () {
                window.location.href = a.__router.login, a.cookies.del("ALREADY_LOGIN")
            }, error: function () {
                window.location.href = a.__router.login, console.error(arguments)
            }
        })
    }

    function e() {
        a(".tip-bottom").tooltip({placement: "bottom"})
    }

    a.siteType = "nto", a.collectData = function (b) {
        if (!b)throw new Error;
        var c = a(b).find("[data-key]"), d = {};
        a.each(c, function (b) {
            var e = c.get(b), f = c.eq(b), g = e.type.toLocaleLowerCase() || e.nodeName.toLocaleLowerCase(), h = f.data("key"), i = d[h] = d[h] || {};
            switch (i.op = f.data("op"), g) {
                case"text":
                case"hidden":
                case"password":
                case"number":
                case"textarea":
                    i.val = a.trim(f.val());
                    break;
                case"select":
                case"select-one":
                case"select-multiple":
                    -1 === f[0].selectedIndex ? delete d[h] : i.val = f[0].options[f[0].selectedIndex].value;
                    break;
                case"radio":
                    f.is(":checked") && (i.val = f.val());
                    break;
                case"checkbox":
            }
        });
        for (var e in d)d[e] = d[e].op ? d[e].op : d[e].val;
        return d
    }, a(document).ready(function () {
        c(), a("#backTop").click(function () {
            a("html,body").animate({scrollTop: 0}, 200)
        }), a("#logout").click(function () {
            d()
        }), e()
    }), a(window).scroll(function () {
        c()
    })
});